<?xml version="1.0" encoding="ISO-8859-1" ?>

<%@page import="test.*"%>

<%@page import="java.sql.*"%>

<%@page import="java.util.*"%>

<%@page import = "java.util.Date" %>
<%@page import = "java.text.DateFormat" %>
<%@page import = "java.text.SimpleDateFormat" %>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel = "stylesheet" type = "text/css" href = "main.css"></link>
<title>List of Conferences</title>
</head>
<body>
<div id = "header">
 <div style="float:left">
 <img height="75px" width="165px" alt="IMAGE" src="./Img/banner1.jpg"/>
 <img height="75px" width="165px" alt="IMAGE" src="./Img/banner2.jpg"/>
 <img height="75px" width="165px" alt="IMAGE" src="./Img/banner3.jpg"/>
 <img height="75px" width="160px" alt="IMAGE" src="./Img/banner5.jpg"/>
  <img height="75px" width="160px" alt="IMAGE" src="./Img/banner4.jpg"/>
   <img height="75px" width="162px" alt="IMAGE" src="./Img/banner7.jpg"/> 
 </div>
 
 </div> 
 <div id = "main" > 
 <div id = "main-left"> 
 <div id = "links">
 <a id = "link1" href ="Home.jsp"> Home </a>
 <br/>
 <br/>
 <a id = "link2" href = ""> About Conference</a>
  <br/>
 <br/>
 <a id = "link3" href = "RegisterConference.jsp"> Register</a>
  <br/>
 <br/>
 <a id = "link4" href = "ListOfAttendees.jsp"> List of Attendees</a>
  <br/>
 <br/>
 <a id = "link5" href = "PresentWorkshop.jsp">Present a Workshop</a>
  <br/>
 <br/>
 <a id = "link5" href = "">Administrator</a>
 <br/>
 <br/>
 <a id = "link6" href = "">My Profile</a>
 </div>
 </div>
 <div id = "main-right">
  <h1 id = "title" ><em>Tutor/Mentor Leadership And Networking Conference</em> </h1>
  <div class = "myProfile">
  <p id = "instruction1"> <b>The conferences between <%= request.getParameter("startDate") %> and 
  
  <%= request.getParameter("endDate") %> are listed below</b><br/>
  To view more information about each conference click on the link
   </p> 
  <br/>
  <ul>
  <%DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
String startD = request.getParameter("startDate");

String endD = request.getParameter("endDate");
System.out.println("In viewConferences1" + endD);
Date startDate = df.parse(startD);
Date endDate = df.parse(endD);

try{
	ConferenceDataAccess confdata = new ConferenceDataAccess();
	Conference conf = new Conference();
	List <Conference>l1 = new ArrayList<Conference>();
	java.sql.Date sqlStartDate =new java.sql.Date(startDate.getTime());
	java.sql.Date sqlEndDate =new java.sql.Date(endDate.getTime());
	l1 = confdata.getConferencesForSelectedDates(sqlStartDate,sqlEndDate);
	Iterator<Conference> i = l1.iterator();
	while(i.hasNext())
	{
		conf = i.next();
		String nameOfConference = conf.getConfName();
		Date startDateOfConference = conf.getStartDate();
		Date endDateOfConference = conf.getEndDate();
		int conferenceId = conf.getConfId();
		
		%><li> <a href = "http://localhost/test/conferenceDetails.jsp?confid=<%=conferenceId%>&confName=<%=nameOfConference%>&startDate=<%=startDateOfConference%>&endDate=<%=endDateOfConference%>"><%= nameOfConference%> </a> <p> Starts on <%=startDateOfConference%> and Ends on
		<%=endDateOfConference%></p>
		<br/>
		<br/>
		</li>
		<%	
	}
}catch(Exception e){
	e.printStackTrace();
}
%>

  </ul>
   
   </div>
    </div>
  </div>
  <div id = "footer">
 </div>
</body>
</html>